<div class="yui-g">
    <table id="editgrid"></table>
    <div id="pager"></div>
</div>
<script type="text/javascript">
    jQuery(document).ready(function(){
        jQuery("#editgrid").jqGrid({
            url:'<?=base_url();?>index.php/admin/comentarios/post',
            datatype: 'json',
            mtype: 'POST',
            colNames:['id','Id Noticia','Texto','Peso','Usuario'],
            colModel :[
                {name:'id', index:'id', width:90,editable:false,editoptions:{size:10}},
                {name:'id_noticia', index:'id_noticia', width:120,editable:true,editoptions:{size:20}},
                {name:'texto', index:'texto', width:120,editable:true,editoptions:{size:20}, align:'right'},
                {name:'peso_2', index:'peso_2', width:80,editable:true,editoptions:{size:20}, align:'right'},
                {name:'usuario', index:'usuario', width:80,editable:true,editoptions:{size:20}, align:'right'},
            ],
            pager: '#pager',
            rowNum:20,
            rowList:[10,20,30],
            sortname: 'id_noticia',
            sortorder: 'desc',
            viewrecords: true,
            caption: 'Comentarios',
            height:'100%',
            width:'100%',
            editurl:"<?=base_url();?>index.php/admin/comentarios/guardar"
        });
        jQuery("#editgrid").jqGrid('navGrid',"#pager",{edit:true,add:true,del:true});
    });
</script>
